package ink.lovejinhu.GoldenCodeOfProgrammerInterview;

public class Interview_0102 {
    int[] count=new int[26];
    public boolean CheckPermutation(String s1, String s2) {
        if (s1.length()!=s2.length()) {
            return false;
        }
        for (int i = 0; i < s1.length(); i++) {
            count[s1.charAt(i)-'a']++;
            count[s2.charAt(i)-'a']--;
        }
        for (int i = 0; i < count.length; i++) {
            if (count[i]!=0) {
                return false;
            }
        }
        return true;
    }
}
